package com.info.widgets.Utill;
import java.sql.*;
import javax.sql.*;
public class jdbcInsert {


public static void main(String args[]){
String dbtime;
String dbUrl = "jdbc:mysql://localhost:3306/mycaspian";
String dbClass = "com.mysql.jdbc.Driver";
String query = "SELECT * FROM mycaspian.sign_in";

try {

Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection (dbUrl,"root","admin");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
/*
while (rs.next()) {
dbtime = rs.getString(2);
System.out.println(dbtime);
} //end while*/
PreparedStatement pst = null;

/*pst = con.prepareStatement("INSERT INTO mycaspian.sign_in(id,username) VALUES(?,?)");
pst.setString(1, "10");
pst.setString(2, "xyz");
pst.executeUpdate();
*/
//pst = con.prepareStatement("INSERT INTO mycaspian.sign_up (first_name,middle_name,last_name,data_of_birth,cits_user_id,company_email_id,passportnumber,phone_number,secured_question,answer,zip,country,city,state,captcha_code,id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)");
pst = con.prepareStatement("INSERT INTO mycaspian.sign_up(first_name,id) VALUES(?, ?)");

pst.setString(1, "Mano151");
pst.setString(2, "181");
/*pst.setString(3, "10");
pst.setString(4, "xyz");
pst.setString(5, "10");
pst.setString(6, "xyz");
pst.setString(7, "10");
pst.setString(8, "xyz");
pst.setString(9, "10");
pst.setString(10, "xyz");
pst.setString(11, "10");
pst.setString(12, "xyz");
pst.setString(13, "10");
pst.setString(14, "xyz");
pst.setString(15, "10");
pst.setString(16, "xyz");*/
pst.executeUpdate();
con.close();
} //end try

catch(ClassNotFoundException e) {
e.printStackTrace();
}

catch(SQLException e) {
e.printStackTrace();
}

}  //end main

}  //end class
